//
//  TilingView.mm
//  AudiHistory
//
//  Created by niko on 11-8-20.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "TilingView.h"
#import "CPageDataStruct.h"
#import <MediaPlayer/MediaPlayer.h>
#import "AudiHistoryViewController.h"

#define IntervalTime 1.5

@interface TempScrollView : UIScrollView
@end

@implementation TempScrollView

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
	//[UIView beginAnimations: nil context: nil];
	//[UIView setAnimationDelay:0.0];
	//[UIView setAnimationDuration:(IntervalTime)];
	//self.bounds = CGRectMake(self.bounds.size.width, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height);
	//[UIView commitAnimations];
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

@end

@implementation TilingView
@synthesize nIndex = m_nIndex;
@synthesize pImageL = m_pImageL;
@synthesize pImageR = m_pImageR;
@synthesize pLoading = m_pLoading;

- (id)initWithIndex:(int)nIndex size:(CGSize)size
{
    if ((self = [super initWithFrame:CGRectMake(0, 0, size.width, size.height)]))
	{
		m_nIndex = nIndex;
		CPageDataStruct *pPageDataStruct = [CPageDataStructTable GetPageDataByPagenum:nIndex];
		
		if (nil == pPageDataStruct)
		{
			return self;
		}
		
        UIImage *imageL = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(pPageDataStruct.strImageL)];
		m_pImageL = [[UIImageView alloc] initWithImage:imageL];//其实这里没有被retain过
		m_pImageL.alpha = 0;
		
		//右图片
		UIImage *imageR = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(pPageDataStruct.strImageR)];
		m_pImageR = [[UIImageView alloc] initWithImage:imageR];
		m_pImageR.alpha = 0;
		
		[self addSubview:m_pImageL];
		[self addSubview:m_pImageR];
		m_pImageR.center = CGPointMake(imageR.size.width * 1.5, m_pImageR.center.y);
		
		[imageL release];
		[imageR release];
		
		m_nCanTouch = FALSE;
		m_bRepeat = TRUE;
		m_bNew = FALSE;
    }
    return self;
}

- (void)Clear
{
	m_bRepeat = FALSE;
}

- (void)dealloc
{	
	//先干掉之前的图片
	[m_pImageL removeFromSuperview];
	[m_pImageR removeFromSuperview];
	self.pImageL = nil;
	self.pImageR = nil;
	//RELEASE_OBJECT(m_pImageL);
	//RELEASE_OBJECT(m_pImageR);

	if (nil != m_pMoviePlayer)
	{
		[m_pMoviePlayer stop];
		[[m_pMoviePlayer view] removeFromSuperview];
		RELEASE_OBJECT(m_pMoviePlayer);
		[[NSNotificationCenter defaultCenter] removeObserver:self];
	}
	
	if (m_pScrollView0)
	{
		[m_pScrollView0 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView0);
	}
	if (m_pScrollView1)
	{
		[m_pScrollView1 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView1);
	}
	if (m_pScrollView2)
	{
		[m_pScrollView2 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView2);
	}
	if (m_pScrollView3)
	{
		[m_pScrollView3 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView3);
	}
	if (m_pScrollView4)
	{
		[m_pScrollView4 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView4);
	}
	
	
	[self DeleteLoading];
	
	[UIApplication sharedApplication].statusBarHidden = TRUE;
	
    [super dealloc];
}

-(NSString*) fullPathFromRelativePath:(NSString*) relPath
{
	NSAssert(relPath != nil, @"CCFileUtils: Invalid path");
	
	NSString *fullpath = nil;
	
	// only if it is not an absolute path
	if( ! [relPath isAbsolutePath] )
	{
		NSString *file = [relPath lastPathComponent];
		NSString *imageDirectory = [relPath stringByDeletingLastPathComponent];
		
		fullpath = [[NSBundle mainBundle] pathForResource:file
												   ofType:nil
											  inDirectory:imageDirectory];
	}
	
	if (fullpath == nil)
		fullpath = relPath;
	
	///fullpath = [self getDoubleResolutionImage:fullpath];
	
	return fullpath;	
}

-(void)CanTouch
{
	m_nCanTouch = TRUE;
}

-(void)Load
{
	//创建加载动画
	[self CreatLoading];
	
	CPageDataStruct *pPageDataStruct = [CPageDataStructTable GetPageDataByPagenum:m_nIndex];
	
	if (nil == pPageDataStruct)
	{
		return;
	}
	
	NSString *strImage = pPageDataStruct.strImageThumb;
	
	if ([strImage rangeOfString:@"008"].length > 0)
	{
		
	}
	else if (
			//([strImage rangeOfString:@"010"].length > 0) ||
//			([strImage rangeOfString:@"011"].length > 0) ||
//			([strImage rangeOfString:@"012"].length > 0) ||
			([strImage rangeOfString:@"013"].length > 0)
			)
	{
		
	}
	else 
	{
		//创建淡出动画右
		[self RightAnimating];
		//创建淡出动画左
		[self performSelector:@selector(LeftAnimating) withObject:nil afterDelay:IntervalTime * 0.8];
	}
	
	//加载特殊的东西
	[self LoadEx];
	
	//删除加载动画
	[self performSelector:@selector(HideLoading) withObject:nil afterDelay:IntervalTime];
	//[self performSelector:@selector(DeleteLoading) withObject:nil afterDelay:IntervalTime * 2];
}

-(void)DrawLine:(id)obj
{
	UIScrollView* objTemp = (UIScrollView*)obj;
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	objTemp.frame = CGRectMake(0, 0, objTemp.contentSize.width,  objTemp.contentSize.height);
	[UIView commitAnimations];
}

-(void)Repeat:(id)obj
{
	UIView* objTemp = (UIView*)obj;
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	//[UIView setAnimationRepeatCount:100];
	if (objTemp.alpha > 0.5)
	{
		objTemp.alpha = 0.0;
	}
	else
	{
		objTemp.alpha = 1.0;
	}
	
	[UIView commitAnimations];
	
	if (m_bRepeat)
	{
		[self performSelector:@selector(Repeat:) withObject:objTemp afterDelay:IntervalTime];
	}
}

-(void)Show:(id)obj
{
	UIView* objTemp = (UIView*)obj;
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	objTemp.alpha = 1.0;
	[UIView commitAnimations];
}

- (void)CreatLoading
{
	UIImage *image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"01.png")];

	self.pLoading = nil;
	
	m_pLoading = [[UIImageView alloc] initWithImage:image];
	[self addSubview:m_pLoading];
	m_pLoading.center = CGPointMake(m_pImageR.center.x - (m_pImageR.image.size.width * 0.5), m_pImageR.center.y);
	
	UIScrollView *pUIScrollView = (UIScrollView *)(self.superview);
	float zoomScale = pUIScrollView.zoomScale;
	
	zoomScale = (zoomScale > 0.99) ? 0 : (zoomScale * 0.75);
	m_pLoading.bounds = CGRectMake(0, 0, image.size.width * (1 + zoomScale), image.size.height * (1 + zoomScale));
	RELEASE_OBJECT(image);
	
	//NSLog(@"bounds : %f %f %f %f ", m_pLoading.bounds.origin.x, m_pLoading.bounds.origin.y, m_pLoading.bounds.size.width, m_pLoading.bounds.size.height);
	
	NSMutableArray* arrayTemp = [NSMutableArray array];
	for (int i = 1; i < 25; i++)
	{
		NSString *strName = [NSString stringWithFormat:@"%02d.png", i];
		UIImage *image = [[UIImage imageWithContentsOfFile:fullPathFromRelativePath(strName)] autorelease];
		[arrayTemp addObject:image];
		//RELEASE_OBJECT(image);
	}
	m_pLoading.animationImages = arrayTemp;
	[m_pLoading startAnimating];
	
	
}

- (void)DeleteLoading
{
	[m_pLoading stopAnimating];
	[m_pLoading removeFromSuperview];
	m_pLoading = nil;
	//RELEASE_OBJECT(m_pLoading);
}

- (void)HideLoading
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	m_pLoading.alpha = 0;
	[UIView commitAnimations];
}

- (void)LeftAnimating
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	m_pImageL.alpha = 1.0;
	[UIView commitAnimations];
	
	[self performSelector:@selector(CanTouch) withObject:nil afterDelay:IntervalTime];
}

- (void)RightAnimating
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	m_pImageR.alpha = 1.0;
	[UIView commitAnimations];
}

-(void)ShowTextAnimating
{
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	
	if (m_pScrollView0)
	{
		m_pScrollView0.alpha = 1.0;
	}
	if (m_pScrollView1)
	{
		m_pScrollView1.alpha = 1.0;
	}
	if (m_pScrollView2)
	{
		m_pScrollView2.alpha = 1.0;
	}
	if (m_pScrollView3)
	{
		m_pScrollView3.alpha = 1.0;
	}
	if (m_pScrollView4) 
	{
		m_pScrollView4.alpha = 1.0;
	}
	
	[UIView commitAnimations];
}

-(void)ShowTextAnimating2
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	
	if (m_pScrollView4) 
	{
		m_pScrollView4.alpha = 1.0;
	}
	
	[UIView commitAnimations];
}


-(void)LoadEx
{
	CPageDataStruct *pPageDataStruct = [CPageDataStructTable GetPageDataByPagenum:m_nIndex];
	
	if (nil == pPageDataStruct)
	{
		return;
	}
	
	NSString *strImage = pPageDataStruct.strImageThumb;
	
	UIImage *image = nil;
	UIImageView *pText = nil;
	UIScrollView *pScrollView = nil;
	
	if ([strImage rangeOfString:@"028"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_028_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 433, image.size.width, 300)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView flashScrollIndicators];
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"032"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_032_words_01.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(6, 10, image.size.width, 730)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_032_words_02.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(512 + 6, 10, image.size.width, 730)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView2 = [pScrollView retain];
		m_pScrollView2.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:0.1];
	}
	
	if ([strImage rangeOfString:@"036"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_036_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(525, 67, image.size.width, 647)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"065"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_065_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(685, 0, image.size.width, 748)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"076"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_076_words1.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(512 + 10, 0, image.size.width, 557)];
		
		//NSLog(@"%f %f %f %f", pScrollView.bounds.origin.x, pScrollView.bounds.origin.y, pScrollView.bounds.size.width, pScrollView.bounds.size.height);
		//pScrollView.bounds = CGRectMake(pScrollView.bounds.origin.x, pScrollView.bounds.origin.y, image.size.width - 0.70, pScrollView.bounds.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_076_words2.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(512 + 204 + 40, 263 + 10, image.size.width, 557)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView2 = [pScrollView retain];
		m_pScrollView2.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"079"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_079_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(512 + 245, 0, image.size.width, 738)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	
	if ([strImage rangeOfString:@"081"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_081b.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		[self addSubview:pText];
		
		m_pScrollView2 = [pText retain];
		m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(LoadExAnimating1) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
		[self performSelector:@selector(LoadExAnimating081) withObject:nil afterDelay:((IntervalTime * 2) * 0.8) + (IntervalTime * 0.5)];
	}
	
	//if ([strImage rangeOfString:@"093"].length > 0)
//	{
//		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_093_words.png")];
//		pText = [[UIImageView alloc] initWithImage:image];
//		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 388, image.size.width, 360)];
//		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
//		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
//		//pScrollView.bouncesZoom = YES;
//		//pScrollView.zoomScale = 0.5;
//		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
//		pScrollView.showsVerticalScrollIndicator = YES;
//        pScrollView.showsHorizontalScrollIndicator = NO;
//		[pScrollView addSubview:pText];
//		[self addSubview:pScrollView];
//		
//		m_pScrollView1 = [pScrollView retain];
//		m_pScrollView1.alpha = 0;
//		RELEASE_OBJECT(pScrollView);
//		RELEASE_OBJECT(image);
//		
//		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
//	}
	
	if ([strImage rangeOfString:@"096"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_096_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(620, 0, image.size.width, 720)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"097"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_097_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, 300)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	
	if ([strImage rangeOfString:@"099"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_099_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(600, 0, image.size.width, 735)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"100"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_100_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(520, 0, image.size.width, 270)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pText.center = CGPointMake(pText.center.x, pText.center.y + (image.size.height * 0.6));
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"107"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_107_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 10, image.size.width, 440)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		pText.center = CGPointMake(pText.center.x, pText.center.y);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"108"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_108_words1.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 170, image.size.width, 550)];
		
		//NSLog(@"%f %f %f %f", pScrollView.bounds.origin.x, pScrollView.bounds.origin.y, pScrollView.bounds.size.width, pScrollView.bounds.size.height);
		//pScrollView.bounds = CGRectMake(pScrollView.bounds.origin.x, pScrollView.bounds.origin.y, image.size.width - 0.70, pScrollView.bounds.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_108_words2.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(512 + 10, 170, image.size.width, 550)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView2 = [pScrollView retain];
		m_pScrollView2.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
		
	if ([strImage rangeOfString:@"109"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_109_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(26, 425, 967, image.size.height)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
		
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_109b.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		[self addSubview:pText];
		
		m_pScrollView2 = [pText retain];
		m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(LoadExAnimating1) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
		[self performSelector:@selector(LoadExAnimating109) withObject:nil afterDelay:((IntervalTime * 2) * 0.8) + (IntervalTime * 0.5)];
	}
	
	if ([strImage rangeOfString:@"007"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_008-R.jpg")];
		pText = [[UIImageView alloc] initWithImage:image];
		[self insertSubview:pText belowSubview:m_pImageR];
		
		m_pScrollView2 = [pText retain];
		m_pScrollView2.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
		m_pScrollView2.alpha = 0;
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(LoadExAnimating3) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"008"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_007-R.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		//[self insertSubview:pText aboveSubview:m_pImageR];
		
		pScrollView = [[TempScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width*2, image.size.height)];
		pScrollView.contentSize = CGSizeMake(image.size.width * 4, image.size.height);
		[pScrollView addSubview:pText];
		pText.center = CGPointMake(image.size.width * 1.5, pText.center.y); 
		//pText.frame = CGRectMake(1024 + 512, 0, image.size.width, image.size.height);
		RELEASE_OBJECT(image);
		pText.alpha = 0;
		[self Show:pText];
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_007-L.jpg")];
		pText = [[UIImageView alloc] initWithImage:image];
		//[self insertSubview:pText aboveSubview:m_pImageR];
		[pScrollView addSubview:pText];
		//pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
		//pScrollView.contentSize = CGSizeMake(image.size.width * 2, image.size.height);
		//pText.frame = CGRectMake(1024, 0, image.size.width, image.size.height);
		RELEASE_OBJECT(image);
		pText.alpha = 0;
		[self performSelector:@selector(Show:) withObject:pText afterDelay:(IntervalTime) * 0.8];
		
		//创建淡出动画右
		[self performSelector:@selector(RightAnimating) withObject:nil afterDelay:IntervalTime * 1.3];
		//创建淡出动画左
		[self performSelector:@selector(LeftAnimating) withObject:nil afterDelay:IntervalTime * 1.3];
		
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		pScrollView.pagingEnabled = YES;
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		pScrollView.delegate = self;
		//[self insertSubview:pScrollView aboveSubview:m_pImageR];
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(-1024, m_pScrollView2.center.y);
		//m_pScrollView2.alpha = 0;
	}
		
	if ([strImage rangeOfString:@"013"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_013-R.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		//[self insertSubview:pText aboveSubview:m_pImageR];
		
		pScrollView = [[TempScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width*2, image.size.height)];
		pScrollView.contentSize = CGSizeMake(image.size.width * 4, image.size.height);
		[pScrollView addSubview:pText];
		pText.center = CGPointMake(image.size.width * 1.5, pText.center.y); 
		//pText.frame = CGRectMake(1024 + 512, 0, image.size.width, image.size.height);
		RELEASE_OBJECT(image);
		pText.alpha = 0;
		[self Show:pText];
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_013-L.jpg")];
		pText = [[UIImageView alloc] initWithImage:image];
		//[self insertSubview:pText aboveSubview:m_pImageR];
		[pScrollView addSubview:pText];
		//pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
		//pScrollView.contentSize = CGSizeMake(image.size.width * 2, image.size.height);
		//pText.frame = CGRectMake(1024, 0, image.size.width, image.size.height);
		RELEASE_OBJECT(image);
		pText.alpha = 0;
		[self performSelector:@selector(Show:) withObject:pText afterDelay:(IntervalTime) * 0.8];
		
		//创建淡出动画右
		[self performSelector:@selector(RightAnimating) withObject:nil afterDelay:IntervalTime * 1.3];
		//创建淡出动画左
		[self performSelector:@selector(LeftAnimating) withObject:nil afterDelay:IntervalTime * 1.3];
		
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		pScrollView.pagingEnabled = YES;
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		pScrollView.delegate = self;
		//[self insertSubview:pScrollView aboveSubview:m_pImageR];
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(-1024, m_pScrollView2.center.y);
		//m_pScrollView2.alpha = 0;		
	}
	
	if ([strImage rangeOfString:@"078"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_078b.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pText.alpha = 0;
		[self addSubview:pText];
	
		[self performSelector:@selector(Repeat:) withObject:pText afterDelay:(IntervalTime) * 1.8];
		m_pScrollView2 = [pText retain];
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		RELEASE_OBJECT(image);
	}
	
	
	if ([strImage rangeOfString:@"066"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_066_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 0, image.size.height)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"067"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_067_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, 0)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"068"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_068_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, 0)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"069"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_069_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(740, 0, image.size.width, 738)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
		
		
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_069_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 0, image.size.height)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"070"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_070_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 0, image.size.height)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"071"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_071_line.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, 0)];
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height);
		[pScrollView addSubview:pText];
		[self insertSubview:pScrollView belowSubview:m_pLoading];
		
		[self performSelector:@selector(DrawLine:) withObject:pScrollView afterDelay:(IntervalTime) * 1.5];
		
		RELEASE_OBJECT(image);
		m_pScrollView2 = [pScrollView retain];
		RELEASE_OBJECT(pScrollView);
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		
	}
	
	if ([strImage rangeOfString:@"073"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_073_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(595, 0, image.size.width, 748)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"074"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_074_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(728, 10, image.size.width, 708)];
		//pScrollView.bounds = CGRectMake(0, 0, image.size.width - 200, image.size.height);
		pText.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
		//pScrollView.bouncesZoom = YES;
		//pScrollView.zoomScale = 0.5;
		pScrollView.contentSize = CGSizeMake(image.size.width, image.size.height); //image.size;//CGRectMake(0, 0, image.size.width, image.size.height);
		pScrollView.showsVerticalScrollIndicator = YES;
        pScrollView.showsHorizontalScrollIndicator = NO;
		[pScrollView addSubview:pText];
		[self addSubview:pScrollView];
		
		m_pScrollView1 = [pScrollView retain];
		m_pScrollView1.alpha = 0;
		RELEASE_OBJECT(pScrollView);
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if ([strImage rangeOfString:@"040"].length > 0)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_040_words.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		[self insertSubview:pText belowSubview:m_pImageR];
		
		m_pScrollView4 = [pText retain];
		//m_pScrollView4.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
		m_pScrollView4.alpha = 0;
		RELEASE_OBJECT(image);
		
		[self performSelector:@selector(ShowTextAnimating2) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
		
		[self performSelector:@selector(LoadExAnimating4) withObject:nil afterDelay:(IntervalTime * 2) * 0.8];
	}
	
	if (
		([strImage rangeOfString:@"049"].length > 0) || 
		([strImage rangeOfString:@"051"].length > 0) ||
		([strImage rangeOfString:@"053"].length > 0) ||
		([strImage rangeOfString:@"055"].length > 0) ||
		([strImage rangeOfString:@"058"].length > 0) ||
		([strImage rangeOfString:@"060"].length > 0) ||
		([strImage rangeOfString:@"062"].length > 0)
		)
	{
		image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"tap.png")];
		pText = [[UIImageView alloc] initWithImage:image];
		pText.alpha = 0;
		
		if ([strImage rangeOfString:@"049"].length > 0)
		{
			pText.center = CGPointMake(895, 339);
		}
		
		if ([strImage rangeOfString:@"051"].length > 0)
		{
			pText.center = CGPointMake(858, 366);
		}
		
		if ([strImage rangeOfString:@"053"].length > 0)
		{
			pText.center = CGPointMake(95, 324);
		}
		
		if ([strImage rangeOfString:@"055"].length > 0)
		{
			pText.center = CGPointMake(900, 278);
		}
		
		if ([strImage rangeOfString:@"058"].length > 0)
		{
			pText.center = CGPointMake(80, 476);
		}
		
		if ([strImage rangeOfString:@"060"].length > 0)
		{
			pText.center = CGPointMake(802, 282);
		}
		
		if ([strImage rangeOfString:@"062"].length > 0)
		{
			pText.center = CGPointMake(442, 596);
		}
		
		[self addSubview:pText];
		
		[self performSelector:@selector(Repeat:) withObject:pText afterDelay:(IntervalTime) * 1.8];
		m_pScrollView2 = [pText retain];
		//m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x + image.size.width, m_pScrollView2.center.y);
		RELEASE_OBJECT(image);
	}
	
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
	RELEASE_OBJECT(pScrollView);
}

#pragma mark -
#pragma mark ScrollView delegate methods

- (void)tilePages:(UIScrollView *)scrollView
{
    // Calculate which pages are visible
    CGRect visibleBounds = scrollView.bounds;
    int firstNeededPageIndex = floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds));
    int lastNeededPageIndex  = floorf((CGRectGetMaxX(visibleBounds)-1) / CGRectGetWidth(visibleBounds));
    firstNeededPageIndex = MAX(firstNeededPageIndex, 0);
    lastNeededPageIndex  = MIN(lastNeededPageIndex, 2);
	
	if (firstNeededPageIndex == lastNeededPageIndex)
	{
		if (visibleBounds.origin.x > 1000)
		{
			[scrollView removeFromSuperview];
		}
	}
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
	//NSLog(@"%f %f %f %f", scrollView.bounds.origin.x, scrollView.bounds.origin.y, scrollView.bounds.size.width, scrollView.bounds.size.height);
    [self tilePages:scrollView];
}

-(void)LoadExAnimating4
{
	if (m_pScrollView0)
	{
		[m_pScrollView0 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView0);
	}
	
	if (m_pScrollView1)
	{
		[m_pScrollView1 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView1);
	}
	
	UIImage *image = nil;
	UIImageView *pText = nil;
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_040-L-W.jpg")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self insertSubview:pText belowSubview:m_pImageL];
	m_pScrollView0 = [pText retain];
	m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
	m_pScrollView0.alpha = 0;
	RELEASE_OBJECT(image);
	
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_040-R-W.jpg")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self insertSubview:pText belowSubview:m_pImageR];
	m_pScrollView1 = [pText retain];
	m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
	m_pScrollView1.alpha = 0;
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:(IntervalTime * 2)];
	m_pScrollView1.alpha = 1.0;
	m_pScrollView0.alpha = 1.0;
	m_pImageL.alpha = 0;
	m_pImageR.alpha = 0;
	[UIView commitAnimations];
	
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
	
	if (m_bRepeat)
	{
		[self performSelector:@selector(LoadExAnimating5) withObject:nil afterDelay:(IntervalTime * 2.5)];
	}
}

-(void)LoadExAnimating5
{
	if (m_pScrollView2)
	{
		[m_pScrollView2 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView2);
	}
	
	if (m_pScrollView3)
	{
		[m_pScrollView3 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView3);
	}
	
	UIImage *image = nil;
	UIImageView *pText = nil;
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_040-L-Y.jpg")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self insertSubview:pText belowSubview:m_pImageL];
	m_pScrollView2 = [pText retain];
	m_pScrollView2.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
	m_pScrollView2.alpha = 0;
	RELEASE_OBJECT(image);
	
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_040-R-Y.jpg")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self insertSubview:pText belowSubview:m_pImageR];
	m_pScrollView3 = [pText retain];
	m_pScrollView3.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
	m_pScrollView3.alpha = 0;
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:(IntervalTime * 2)];
	m_pScrollView2.alpha = 1.0;
	m_pScrollView3.alpha = 1.0;
	m_pScrollView0.alpha = 0;
	m_pScrollView1.alpha = 0;
	[UIView commitAnimations];
	
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
	
	if (m_bRepeat)
	{
		[self performSelector:@selector(LoadExAnimating6) withObject:nil afterDelay:(IntervalTime * 2.5)];
	}
	
}

-(void)LoadExAnimating6
{
	if (m_pScrollView0)
	{
		[m_pScrollView0 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView0);
	}
	
	if (m_pScrollView1)
	{
		[m_pScrollView1 removeFromSuperview];
		RELEASE_OBJECT(m_pScrollView1);
	}
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:(IntervalTime * 2)];
	m_pScrollView2.alpha = 0;
	m_pScrollView3.alpha = 0;
	m_pImageL.alpha = 1.0;
	m_pImageR.alpha = 1.0;
	[UIView commitAnimations];
	
	if (m_bRepeat)
	{
		[self performSelector:@selector(LoadExAnimating4) withObject:nil afterDelay:(IntervalTime * 2.5)];
	}
}


-(void)LoadExAnimating3
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime];
	m_pScrollView2.alpha = 1.0;
	[UIView commitAnimations];
}

-(void)LoadExAnimating081
{
	UIImage *image = nil;
	UIImageView *pText = nil;
	
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_081b.png")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self addSubview:pText];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * 0.5];
	pText.bounds = CGRectMake(0, 0, image.size.width * 3, image.size.height * 3);
	pText.alpha = 0;
	pText.center = CGPointMake(pText.center.x, pText.center.y - 400);
	[UIView commitAnimations];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * (0.5 * (1.2 / 3))];
	m_pScrollView2.bounds = CGRectMake(0, 0, image.size.width * 1.1, image.size.height * 1.1);
	[UIView commitAnimations];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * (0.5 * (1.2 / 3))];
	m_pScrollView2.bounds = CGRectMake(0, 0, image.size.width * 1, image.size.height * 1);
	[UIView commitAnimations];
	
	m_pScrollView1 = [pText retain];
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
}

-(void)LoadExAnimating109
{
	UIImage *image = nil;
	UIImageView *pText = nil;
	
	image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_109b.png")];
	pText = [[UIImageView alloc] initWithImage:image];
	[self addSubview:pText];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * 0.5];
	pText.bounds = CGRectMake(0, 0, image.size.width * 3, image.size.height * 3);
	pText.alpha = 0;
	//m_pScrollView1.center = CGPointMake(m_pScrollView2.center.x, m_pScrollView2.center.y);
	[UIView commitAnimations];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * (0.5 * (1.2 / 3))];
	m_pScrollView2.bounds = CGRectMake(0, 0, image.size.width * 1.1, image.size.height * 1.1);
	[UIView commitAnimations];
	
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * (0.5 * (1.2 / 3))];
	m_pScrollView2.bounds = CGRectMake(0, 0, image.size.width * 1, image.size.height * 1);
	[UIView commitAnimations];
	
	m_pScrollView1 = [pText retain];
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
}

-(void)LoadExAnimating1
{
	[UIView beginAnimations: nil context: nil];
	[UIView setAnimationDelay:0.0];
	[UIView setAnimationDuration:IntervalTime * 0.5];
	m_pScrollView2.center = CGPointMake(m_pScrollView2.center.x - 1024, m_pScrollView2.center.y);
	[UIView commitAnimations];
}

-(void)MoviePlayerDone
{
	[m_pMoviePlayer stop];
	[[m_pMoviePlayer view] removeFromSuperview];
	RELEASE_OBJECT(m_pMoviePlayer);
	[[NSNotificationCenter defaultCenter] removeObserver:self];
}

-(void)moviePlayerLoadStateChanged:(id)ibaction
{
	
}

//-(void)moviePlayerEvent:(NSNotification*)aNotification
//{
//	[UIApplication sharedApplication].statusBarHidden = TRUE;
	//NSLog(@"%i", [UIApplication sharedApplication].statusBarHidden);
//}

-(void)moviePlayBackDidFinish:(id)ibaction
{
	[self MoviePlayerDone];
}

-(void)Event
{
	CPageDataStruct *pPageDataStruct = [CPageDataStructTable GetPageDataByPagenum:m_nIndex];
	
	if (nil == pPageDataStruct)
	{
		return;
	}
	
	NSString *strImage = pPageDataStruct.strImageThumb;
	
	if ([strImage rangeOfString:@"078"].length > 0)
	{
		if (nil != m_pMoviePlayer)
		{
			return;
		}
		
		[[AudiHistoryViewController SharedObj] HideIndexBar];
		
		NSURL *videoURL = [[NSURL alloc] initFileURLWithPath:[self fullPathFromRelativePath:@"audi.mp4"]];
		m_pMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];//用url初始化对象
		
		//m_pMoviePlayer.scalingMode=MPMovieScalingModeAspectFit;//窗口模式设置
		m_pMoviePlayer.controlStyle = MPMovieControlStyleFullscreen;//一共有四种，可参考文档，设计播放控制样式
		//设置视频显示区域
		//CGRect rect = [self bounds];
		CGRect rect = CGRectMake([self bounds].origin.x, [self bounds].origin.y + 10, [self bounds].size.width, [self bounds].size.height - 20);
		[[m_pMoviePlayer view] setFrame:rect]; 
		[self addSubview:[m_pMoviePlayer view]]; 
		
		//if ([m_pMoviePlayer respondsToSelector:@selector(loadState)]) 
		//{
		//	// Register that the load state changed (movie is ready)
		//	[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerLoadStateChanged:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
		//}
		//else
		//{
		//	[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePreloadDidFinish:) name:MPMoviePlayerContentPreloadDidFinishNotification object:nil];
		//}
		
		// Register to receive a notification when the movie has finished playing. 
		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];		
		
		//NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
		//[notificationCenter addObserver:self selector:@selector(moviePlayerEvent:) name:MPMoviePlayerLoadStateDidChangeNotification object:m_pMoviePlayer];
		
		//开始播放
		[m_pMoviePlayer play];
	}
	
	UIImage *image = nil;
	UIImageView *pText = nil;
	
	if ([strImage rangeOfString:@"049"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}

		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_050-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_050-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
			
			m_bNew = TRUE;
		}
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}

		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
	
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"051"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_052-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_052-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
		}
		
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"053"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_054-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_054-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
		}
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"055"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_056-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_056-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
		}
		
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"058"].length > 0)
	{
		//if (nil != m_pScrollView0)
		//		{
		//			return;
		//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_059-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_059-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
		}
		
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"060"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_061-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_061-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;
		}
		
		
		
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	if ([strImage rangeOfString:@"062"].length > 0)
	{
		//if (nil != m_pScrollView0)
//		{
//			return;
//		}
		
		if (nil == m_pScrollView0)
		{
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_063-L.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageL];
			m_pScrollView0 = [pText retain];
			m_pScrollView0.center = CGPointMake(m_pImageL.center.x, m_pImageL.center.y);
			m_pScrollView0.alpha = 0;
			RELEASE_OBJECT(image);
			
			image = [[UIImage alloc] initWithContentsOfFile:fullPathFromRelativePath(@"audi_history_063-R.jpg")];
			pText = [[UIImageView alloc] initWithImage:image];
			[self insertSubview:pText belowSubview:m_pImageR];
			m_pScrollView1 = [pText retain];
			m_pScrollView1.center = CGPointMake(m_pImageR.center.x, m_pImageR.center.y);
			m_pScrollView1.alpha = 0;			
		}
				
		[UIView beginAnimations: nil context: nil];
		[UIView setAnimationDelay:0.0];
		[UIView setAnimationDuration:(IntervalTime)];
		if (m_pScrollView1.alpha > 0.5)
		{
			m_pScrollView1.alpha = 0;
			m_pScrollView0.alpha = 0;
		}
		else
		{
			m_pScrollView1.alpha = 1.0;
			m_pScrollView0.alpha = 1.0;
		}
		
		if (m_pImageL.alpha > 0.5)
		{
			m_pImageL.alpha = 0;
			m_pImageR.alpha = 0;
		}
		else
		{
			m_pImageL.alpha = 1.0;
			m_pImageR.alpha = 1.0;
		}
		
		[UIView commitAnimations];
	}
	
	//if ([strImage rangeOfString:@"008"].length > 0)
//	{
//		UIScrollView *scroll = (UIScrollView*)m_pScrollView2;
//		[UIView beginAnimations: nil context: nil];
//		[UIView setAnimationDelay:0.0];
//		[UIView setAnimationDuration:(IntervalTime)];
//		scroll.bounds = CGRectMake(1536.000000, scroll.bounds.origin.y, scroll.bounds.size.width, scroll.bounds.size.height);
//		[UIView commitAnimations];
//	}
	
	RELEASE_OBJECT(image);
	RELEASE_OBJECT(pText);
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
	if (TRUE == m_nCanTouch)
	{
		[self Event];
	}	
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
	
}

@end
